package cn.org.eshow.webapp.action.response;


import cn.org.eshow.model.ProductItem;

import java.util.Date;

/**
 * 详细商品返回对象
 */
public class ProductItemResponse {
    public Integer id;//详细商品ID
    public Date addTime = new Date();// 添加时间
    public Date updateTime = new Date();// 更新时间
    public String title = "";// 详细商品标题(颜色)
    public Double price = 0.00;// 单价
    public String img = "";//主图片
    public String description;//描述
    public Integer state = 1;//状态（1上架，0下架）

    public ProductItemResponse() {
    }

    public ProductItemResponse(ProductItem productItem) {
        this.id = productItem.getId();
        this.addTime = productItem.getAddTime();
        this.updateTime = productItem.getUpdateTime();
        this.title = productItem.getTitle();
        this.price = productItem.getPrice();
        this.img = productItem.getImg() == null ? "" : productItem.getImg();
        this.description = productItem.getDescription() == null ? "" : productItem.getDescription();
        this.state = productItem.getState();
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Date getAddTime() {
        return addTime;
    }

    public void setAddTime(Date addTime) {
        this.addTime = addTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public String getImg() {
        return img;
    }

    public void setImg(String img) {
        this.img = img;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }
}